Class ACLImpl

java.lang.Object
com.cisco.pt.ipc.impl.IPCObjectImpl
com.cisco.pt.ipc.sim.impl.ACLImpl
All Implemented Interfaces:
IPCObject, ACL

public class ACLImpl extends IPCObjectImpl implements ACL
Information provided by the PKI file:

    \class Acl
    
    \brief Acl holds and manipulates AclStatements.
    
    \example network().getDevice("Router0").getProcess("AclProcess").getAcl("aclID")
    
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • addStatement

      public boolean addStatement(String statement)
      Information provided by the PKI file:
      
          \brief Adds an ACL statement to this ACL.
          
          \param statement,   the IOS ACL statement. "access-list [this-aclid]" should be omitted.
          Start with "permit, deny, or remark".
          
          \return bool, true if added successfully, otherwise false.
          
              
      Specified by:
      addStatement in interface ACL
      Parameters:
      statement - Takes in a parameter of statement
      Returns:
      boolean Returns a boolean
    • addExtStatement

      public boolean addExtStatement(boolean bIsIpv6, String protocol, boolean permit, String remoteIp, String remoteMask, int remotePort, String localIp, String localMask, int localPort)
      Information provided by the PKI file:
      
          \brief Adds an ACL statement to this ACL with the specified parameters.
          
          \param protocol, valid protocols are IP, ICMP, TCP, and UDP.
          \param remoteIp, the remote IP adddress.
          \param remoteMask, the remote wildcard mask.
          \param remotePort, the remote port for TCP and UDP.
          \param localIp, the local IP address.
          \param localMask, the local wildcard mask.
          \param localPort, the local port for TCP and UDP.
          
          \return bool, true if added successfully, otherwise false.
          
              
      Specified by:
      addExtStatement in interface ACL
      Parameters:
      bIsIpv6 - Takes in a parameter of bIsIpv6
      protocol - Takes in a parameter of protocol
      permit - Takes in a parameter of permit
      remoteIp - Takes in a parameter of remoteIp
      remoteMask - Takes in a parameter of remoteMask
      remotePort - Takes in a parameter of remotePort
      localIp - Takes in a parameter of localIp
      localMask - Takes in a parameter of localMask
      localPort - Takes in a parameter of localPort
      Returns:
      boolean Returns a boolean
    • removeStatement

      public boolean removeStatement(String statement)
      Information provided by the PKI file:
      
          \brief Removes an ACL statement from this ACL.
          
          \param statement    the IOS ACL statement. "access-list [this-aclid]" should be omitted.
          Start with "permit, deny, or remark".
          
          \return bool, true if removed successfully, otherwise false.
          
              
      Specified by:
      removeStatement in interface ACL
      Parameters:
      statement - Takes in a parameter of statement
      Returns:
      boolean Returns a boolean
    • removeExtStatement

      public boolean removeExtStatement(boolean bIsIpv6, String protocol, boolean permit, String remoteIp, String remoteMask, int remotePort, String localIp, String localMask, int localPort)
      Information provided by the PKI file:
      
          \brief Removes the ACL statement from this ACL with the specified parameters.
          
          \param protocol, valid protocols are IP, ICMP, TCP, and UDP.
          \param remoteIp, the remote IP adddress.
          \param remoteMask, the remote wildcard mask.
          \param remotePort, the remote port for TCP and UDP.
          \param localIp, the local IP address.
          \param localMask, the local wildcard mask.
          \param localPort, the local port for TCP and UDP.
          
          \return bool, true if removed successfully, otherwise false.
          
              
      Specified by:
      removeExtStatement in interface ACL
      Parameters:
      bIsIpv6 - Takes in a parameter of bIsIpv6
      protocol - Takes in a parameter of protocol
      permit - Takes in a parameter of permit
      remoteIp - Takes in a parameter of remoteIp
      remoteMask - Takes in a parameter of remoteMask
      remotePort - Takes in a parameter of remotePort
      localIp - Takes in a parameter of localIp
      localMask - Takes in a parameter of localMask
      localPort - Takes in a parameter of localPort
      Returns:
      boolean Returns a boolean
    • getStatementAt

      public ACLStatement getStatementAt(int index)
      Information provided by the PKI file:
      
          \brief Returns an ACL statement at the specified index.
          
          \param index, the index of the ACL statement.
          
          \return     AclStatement, the ACL statement at the specified index.
          
              
      Specified by:
      getStatementAt in interface ACL
      Parameters:
      index - Takes in a parameter of index
      Returns:
      ACLStatement Returns a ACLStatement
    • getStatementCount

      public int getStatementCount()
      Information provided by the PKI file:
      
          \brief Returns the number of ACL statements.
          
          \return int, the number of ACL statements.
          
              
      Specified by:
      getStatementCount in interface ACL
      Returns:
      int Returns a int
    • addRemark

      public void addRemark(String remark)
      Information provided by the PKI file:
      
          \brief Adds a remark to this ACL.
          
          \param remark, the remark to be added.
          
              
      Specified by:
      addRemark in interface ACL
      Parameters:
      remark - Takes in a parameter of remark
    • getRemark

      public String getRemark(int index)
      Information provided by the PKI file:
      
          \brief Returns the remark at the specified index.
          
          \param index, the index of the remark.
          
          \return     string, the remark at the specified index.
          
              
      Specified by:
      getRemark in interface ACL
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • getRemarkCount

      public int getRemarkCount()
      Information provided by the PKI file:
      
          \brief Returns the number of remarks in this ACL.
          
          \return int, the number of remarks in this ACL.
          
              
      Specified by:
      getRemarkCount in interface ACL
      Returns:
      int Returns a int
    • getCommandCount

      public int getCommandCount()
      Information provided by the PKI file:
      
          \brief Returns the number of ACL commands.
          
          \return int, the number of ACL commands.
          
              
      Specified by:
      getCommandCount in interface ACL
      Returns:
      int Returns a int
    • getCommandAt

      public String getCommandAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the ACL command at the specified index.
          
          \param int index, the index of the ACL command.
          
          \return string, the ACL command at the specified index.
          
              
      Specified by:
      getCommandAt in interface ACL
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • isExtended

      public boolean isExtended()
      Information provided by the PKI file:
      
          \brief Returns true if this ACL is an extended ACL, false if it is a standard ACL.
          
          \return bool, true if this ACL is an extended ACL, false if it is a standard ACL.
          
              
      Specified by:
      isExtended in interface ACL
      Returns:
      boolean Returns a boolean
    • getAclId

      public String getAclId()
      Information provided by the PKI file:
      
          \brief Returns this ACL's ID.
          
          \return string, this ACL's ID.
          
              
      Specified by:
      getAclId in interface ACL
      Returns:
      String Returns a String
    • getExtStatementDataAt

      public List<String> getExtStatementDataAt(boolean bIsIpv6, int index)
      Information provided by the PKI file:
      
          \brief Returns a vector of the data of the ACL statement at the specified index.
          
          \param index, the index of the ACL statement of interest.
          
          \return vector<string>, a vector of the data of the ACL statement at the specified index.
          
              
      Specified by:
      getExtStatementDataAt in interface ACL
      Parameters:
      bIsIpv6 - Takes in a parameter of bIsIpv6
      index - Takes in a parameter of index
      Returns:
      List<String> Returns a List<String>
    • evaluate

      public boolean evaluate(String jsonPdu)
      Information provided by the PKI file:
      
          \brief Evaluates the ACL against a packet/PDU, and returns true if permitted, false otherwise.
          
          \param jsonPdu, the PDU in JSON serialized format
          
          \return bool, true if permitted, false otherwise
          
              
      Specified by:
      evaluate in interface ACL
      Parameters:
      jsonPdu - Takes in a parameter of jsonPdu
      Returns:
      boolean Returns a boolean
    • getMatch

      public ACLStatement getMatch(String jsonPdu)
      Information provided by the PKI file:
      
          \brief Evaluates the ACL against a packet/PDU, and returns the matched AclStatement.
          
          \param jsonPdu, the PDU in JSON serialized format
          
          \return AclStatement, the matched statement, or null if no match
          
              
      Specified by:
      getMatch in interface ACL
      Parameters:
      jsonPdu - Takes in a parameter of jsonPdu
      Returns:
      ACLStatement Returns a ACLStatement